# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-symath
pkgname=('python2-symath' 'python-symath')
_pkgname=symath
pkgver=0.1.25
pkgrel=12
pkgdesc='Symbolic mathematics for Python.'
arch=('any')
url='https://pypi.org/project/symath/#files'
license=('custom:unknown')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('050b1b98d678affd1f3a7305c9cc04e042d104e7eaaaca1c4b88e044184ab1f2f96f4925e6f015e8391774a055ba69f1144b65b0fe400b767f5866c77beebd01')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-symath() {
  depends=('python2' 'python2-numpy' 'python2-matplotlib' 'python2-pydot'
           'python2-scipy' 'python2-pyparsing')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-symath() {
  depends=('python' 'python-numpy' 'python-matplotlib' 'python-pydot'
           'python-scipy' 'python-pyparsing')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

